-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow declaring existential types inside blocks #52645
Conversation
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thanks for the quick fix.
@bors r+ |
📌 Commit 58758c5de691ff528a4053b84ef7b89f4b71724c has been approved by |
src/libsyntax/parse/parser.rs
Outdated
@@ -4391,6 +4391,10 @@ impl<'a> Parser<'a> { | |||
self.token.is_keyword(keywords::Extern) && self.look_ahead(1, |t| t != &token::ModSep) | |||
} | |||
|
|||
fn is_existential_type_decl(&self) -> bool { | |||
self.token.is_keyword(keywords::Existential) && self.look_ahead(1, |t| t.is_ident()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why check if the next token is an ident rather than checking if it is the keyword type
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because I got confused and panicked by beating the problem with a shovel?
For real: I didn't find a token::Type
and decided "oh checking for the concrete identifier is too hard"... all while i did that before the &&
...
I'll fix it asap
58758c5
to
2e33a55
Compare
@bors r=dtolnay rollup |
📌 Commit 2e33a55 has been approved by |
…tolnay Allow declaring existential types inside blocks fixes rust-lang#52631 r? @dtolnay
Rollup of 7 pull requests Successful merges: - #52391 (Add unaligned volatile intrinsics) - #52402 (impl PartialEq+Eq for BuildHasherDefault) - #52645 (Allow declaring existential types inside blocks) - #52656 (Stablize Redox Unix Sockets) - #52658 (Prefer `Option::map`/etc over `match` wherever it improves clarity) - #52668 (clarify pointer offset function safety concerns) - #52677 (Release notes: add some missing 1.28 libs stabilization) Failed merges: r? @ghost
fixes #52631
r? @dtolnay